import { IsNotEmpty } from 'class-validator';
import { ApiModelProperty } from '@nestjs/swagger';
import { ParentData } from './index';

export class CreateResourceDto {
  // 父节点对象
  @ApiModelProperty()
  @IsNotEmpty()
  parent: ParentData;

  // 父节点id
  @ApiModelProperty()
  @IsNotEmpty()
  parentId: number;

  // 描述
  @ApiModelProperty()
  @IsNotEmpty()
  comments: string;

  // 名称
  @ApiModelProperty()
  @IsNotEmpty()
  label: string;

  // 类型
  @ApiModelProperty()
  @IsNotEmpty()
  type: number;

  // 排序id
  @ApiModelProperty()
  @IsNotEmpty()
  sortId: number;

  // 是否显示在菜单项
  @ApiModelProperty()
  @IsNotEmpty()
  enable: boolean;

  // api地址
  @ApiModelProperty({
    required: false,
  })
  api?: string;

  // icon
  @ApiModelProperty({
    required: false,
  })
  icon?: string;

  // 路由路径
  @ApiModelProperty({
    required: false,
  })
  routePath?: string;

  // 组件路径
  @ApiModelProperty({
    required: false,
  })
  componentPath?: string;
}
